﻿using System.Collections.ObjectModel;
using AntdUI;
using Super.Admin.ViewModels.Base;

namespace Super.Admin.Models.Department
{
    public class DepartmentBaseModel : ViewModelBase
    {
        /// <summary>
        /// 部门ID
        /// </summary>
        public int Id { get; set; } = -1;
        private string _name;
        /// <summary>
        /// 部门名称
        /// </summary>
        public string Name
        {
            get { return _name; }
            set { SetProperty(ref _name, value); }
        }
        /// <summary>
        /// 上级部门ID
        /// </summary>
        public int ParentId { get; set; }
        /// <summary>
        /// 部门状态
        /// </summary>
        public int IsActive { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public string? CreateTime { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public string? UpdateTime { get; set; }
        /// <summary>
        /// 备注信息
        /// </summary>
        public string? Remark { get; set; }
        /// <summary>
        /// 负责人id
        /// </summary>
        public int? PersonInChargeId { get; set; }
        /// <summary>
        /// 缩进级别
        /// </summary>
        public int Level { get; set; }
        private bool _isExpanded;
        /// <summary>
        /// 是否展开
        /// </summary>
        public bool IsExpanded
        {
            get { return _isExpanded; }
            set { SetProperty(ref _isExpanded, value); }
        }
        /// <summary>
        /// 子部门集合
        /// </summary>
        public List<DepartmentDetailModel> DepartmentChild { get; set; } = new List<DepartmentDetailModel>();
        public DepartmentDetailModel[] Children { get; set; }
    }
}
